//
//  ViewController.m
//  text
//
//  Created by apple on 15/9/11.
//  Copyright (c) 2015年 戴维营. All rights reserved.
//

#import "ViewController.h"
#import "CustomView.h"
#import "CustomButton.h"

@interface ViewController ()

{

    CustomView *_customView;
}

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _customView = [[CustomView alloc] initWithFrame:CGRectMake(20, 60, 300, 40)];
    
    _customView.aLabel.backgroundColor = [UIColor orangeColor];
    
    _customView.bLabel.backgroundColor = [UIColor redColor];
    
    _customView.cLabel.backgroundColor = [UIColor blueColor];
    
    _customView.valueChanged = ^(CustomView *sender)
    {
        NSLog(@"progress: %.2f%%",sender.value * 100);
    };
    
    [self.view addSubview:_customView];
    
    CustomButton *btn = [[CustomButton alloc] initWithFrame:CGRectMake(30, 200, 200, 40)];
    
    btn.title = @"保存";
    
    btn.touchUpInside = ^(CustomButton *sender)
    {
        NSLog(@"点击保存");
    };
    
    [self.view addSubview:btn];
    
    // Do any additional setup after loading the view, typically from a nib.
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
